home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.awt;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.LayoutManager;
- import java.awt.Panel;
- import java.awt.Point;
- import java.awt.Rectangle;
-
- public class SplitterPanel extends Panel {
- public static final int SPLIT_VER = 1;
- public static final int SPLIT_HOR = 2;
- public static final int SPLIT_VERTICAL = 1;
- public static final int SPLIT_HORIZONTAL = 2;
- public static final int SPLIT_BOTH = 3;
- public static final int SPLIT_BOTH_V = 4;
- public static final int SPLIT3_LEFT = 5;
- public static final int SPLIT3_RIGHT = 6;
- public static final int SPLIT3_TOP = 7;
- public static final int SPLIT3_BOTTOM = 8;
- private static final int SPLIT_NONE = 0;
- public boolean use3dBdr;
- private boolean enforceMinDim;
- private boolean propResize;
- public int moveSplitCursor;
- private int splitType;
- private boolean isOuter;
- private Dimension curDim;
- private Point curLoc;
- private boolean dimChanged;
- private boolean heightOnly;
- private boolean widthOnly;
- private boolean doMoveSplit;
- private boolean cursorChanged;
- private int moveFromX;
- private int moveFromY;
- private Component spComponent;
- private SplitterPanel sub1;
- private SplitterPanel sub2;
- private SplitterPanel innerSP;
- private SplitterPanel outerSP;
- private Dimension minDim;
- private Dimension prefDim;
- private Color gapColor;
- private int iGapWidth;
- private int iGapHeight;
- private int oGapWidth;
- private int oGapHeight;
- private int iBdrSize;
- private int oBdrSize;
- private boolean bOsFlag;
-
- public SplitterPanel() {
- this(true);
- }
-
- public SplitterPanel(int var1, int var2) {
- this(true);
- if (this != null) {
- ((Component)this).resize(var1, var2);
- }
- }
-
- public SplitterPanel(int var1, int var2, int var3) {
- this(var3);
- if (this != null) {
- ((Component)this).resize(var1, var2);
- }
- }
-
- public SplitterPanel(int var1) {
- this(var1, (Component)null, (Component)null, (Component)null, (Component)null);
- }
-
- public SplitterPanel(int var1, Component var2, Component var3, Component var4, Component var5) {
- this(true);
- if (this != null) {
- switch (var1) {
- case 0:
- if (var2 != null) {
- ((Container)this).add(var2);
- return;
- }
- default:
- return;
- case 1:
- this.split(1, var2, var3);
- return;
- case 2:
- this.split(2, var2, var4);
- return;
- case 3:
- this.split(2);
- this.getSubPanel(1).split(1, var2, var3);
- this.getSubPanel(2).split(1, var4, var5);
- return;
- case 4:
- this.split(1);
- this.getSubPanel(1).split(2, var2, var4);
- this.getSubPanel(2).split(2, var3, var5);
- return;
- case 5:
- this.split(1, (Component)null, var3);
- this.getSubPanel(1).split(2, var2, var4);
- return;
- case 6:
- this.split(1, var2, (Component)null);
- this.getSubPanel(2).split(2, var3, var5);
- return;
- case 7:
- this.split(2, (Component)null, var4);
- this.getSubPanel(1).split(1, var2, var3);
- return;
- case 8:
- this.split(2, var2, (Component)null);
- this.getSubPanel(2).split(1, var4, var5);
- }
- }
- }
-
- private SplitterPanel(boolean var1) {
- this.use3dBdr = true;
- this.enforceMinDim = false;
- this.propResize = true;
- this.moveSplitCursor = 13;
- this.doMoveSplit = false;
- this.cursorChanged = false;
- this.isOuter = var1;
- this.dimChanged = true;
- this.heightOnly = false;
- this.widthOnly = false;
- this.splitType = 0;
- this.setLayout((LayoutManager)null);
- this.minDim = new Dimension(0, 0);
- this.curDim = new Dimension(0, 0);
- this.curLoc = new Point(0, 0);
- this.prefDim = new Dimension(0, 0);
- this.gapColor = Color.lightGray;
- this.iGapWidth = 3;
- this.iGapHeight = 3;
- this.iBdrSize = 2;
- this.oGapWidth = 3;
- this.oGapHeight = 3;
- this.oBdrSize = 2;
- if (var1) {
- this.innerSP = new SplitterPanel(false);
- super.add(this.innerSP, -1);
- this.outerSP = this;
- this.innerSP.outerSP = this;
- }
-
- }
-
- public void setGapColor(Color var1) {
- this.gapColor = new Color(var1.getRed(), var1.getGreen(), var1.getBlue());
- this.propagateChanges();
- }
-
- public Color getGapColor() {
- return this.gapColor;
- }
-
- private void adjustOGapBdr() {
- if (this.oGapWidth < this.oBdrSize) {
- this.oGapWidth = Math.max(0, this.oBdrSize);
- }
-
- if (this.oGapHeight < this.oBdrSize) {
- this.oGapHeight = Math.max(0, this.oBdrSize);
- }
-
- }
-
- public void setGapSizes(int var1) {
- this.iGapWidth = var1;
- this.iGapHeight = var1;
- this.oGapWidth = var1;
- this.oGapHeight = var1;
- this.adjustOGapBdr();
- this.propagateChanges();
- ((Component)this).invalidate();
- }
-
- public void setGapSizes(int var1, int var2) {
- this.iGapWidth = var1;
- this.iGapHeight = var2;
- this.oGapWidth = var1;
- this.oGapHeight = var2;
- this.adjustOGapBdr();
- this.propagateChanges();
- ((Component)this).invalidate();
- }
-
- public void setGapSizes(int var1, int var2, int var3, int var4) {
- this.iGapWidth = var1;
- this.iGapHeight = var2;
- this.oGapWidth = var3;
- this.oGapHeight = var4;
- this.adjustOGapBdr();
- this.propagateChanges();
- ((Component)this).invalidate();
- }
-
- public void setBdrSizes(int var1, int var2) {
- this.iBdrSize = var1;
- this.oBdrSize = var2;
- this.adjustOGapBdr();
- this.propagateChanges();
- ((Component)this).invalidate();
- }
-
- public void setBdrSizes(int var1) {
- this.iBdrSize = var1;
- this.oBdrSize = var1;
- this.adjustOGapBdr();
- this.propagateChanges();
- ((Component)this).invalidate();
- }
-
- public Color gapColor() {
- return this.gapColor;
- }
-
- public void setEnforceMinDim(boolean var1) {
- this.enforceMinDim = var1;
- this.propagateChanges();
- }
-
- public boolean getEnforceMinDim() {
- return this.enforceMinDim;
- }
-
- public void setPropResize(boolean var1) {
- this.propResize = var1;
- this.propagateChanges();
- }
-
- public boolean getPropResize() {
- return this.propResize;
- }
-
- public int getSplitType() {
- SplitterPanel var1 = this;
- if (this.isOuter) {
- var1 = this.innerSP;
- }
-
- return var1.splitType;
- }
-
- public SplitterPanel getSubPanel(int var1) {
- SplitterPanel var2 = this;
- if (this.isOuter) {
- var2 = this.innerSP;
- }
-
- if (var1 == 1) {
- return var2.sub1;
- } else {
- return var1 == 2 ? var2.sub2 : null;
- }
- }
-
- public SplitterPanel getSubPanel(int var1, int var2) {
- return this.getSplitType() == var2 ? this.getSubPanel(var1) : null;
- }
-
- public SplitterPanel getSub2Panel(int var1, int var2, int var3, int var4) {
- SplitterPanel var5 = this.getSubPanel(var1, var2);
- return var5 != null ? var5.getSubPanel(var3, var4) : null;
- }
-
- public SplitterPanel getTopPanel() {
- return this.getSubPanel(1, 2);
- }
-
- public SplitterPanel getBottomPanel() {
- return this.getSubPanel(2, 2);
- }
-
- public SplitterPanel getLeftPanel() {
- return this.getSubPanel(1, 1);
- }
-
- public SplitterPanel getRightPanel() {
- return this.getSubPanel(2, 1);
- }
-
- public SplitterPanel getTopLeftPanel() {
- return this.getSplitType() == 2 ? this.getSub2Panel(1, 2, 1, 1) : this.getSub2Panel(1, 1, 1, 2);
- }
-
- public SplitterPanel getTopRightPanel() {
- return this.getSplitType() == 2 ? this.getSub2Panel(1, 2, 2, 1) : this.getSub2Panel(2, 1, 1, 2);
- }
-
- public SplitterPanel getBottomLeftPanel() {
- return this.getSplitType() == 2 ? this.getSub2Panel(2, 2, 1, 1) : this.getSub2Panel(1, 1, 2, 2);
- }
-
- public SplitterPanel getBottomRightPanel() {
- return this.getSplitType() == 2 ? this.getSub2Panel(2, 2, 2, 1) : this.getSub2Panel(2, 1, 2, 2);
- }
-
- public boolean handleEvent(Event var1) {
- if (var1.target == this && this.isOuter) {
- return this.oGapThis(var1);
- } else {
- switch (var1.id) {
- case 501:
- if (var1.target == this && this.splitType == 2 && this.outerSP.cursorChanged) {
- this.doMoveSplit = true;
- this.moveFromX = var1.x;
- this.moveFromY = var1.y;
- return true;
- } else if (var1.target == this && this.splitType == 1 && this.outerSP.cursorChanged) {
- this.doMoveSplit = true;
- this.moveFromX = var1.x;
- this.moveFromY = var1.y;
- return true;
- }
- case 506:
- if (this.doMoveSplit) {
- return true;
- }
- case 502:
- if (this.doMoveSplit) {
- this.moveSplit(var1.x - this.moveFromX, var1.y - this.moveFromY);
- this.doMoveSplit = false;
- return true;
- }
- case 504:
- case 505:
- default:
- return super.handleEvent(var1);
- case 503:
- if (var1.target == this && this.splitType == 2 && this.inGap1(var1.x, var1.y)) {
- this.setCursor(this.moveSplitCursor);
- return true;
- } else if (var1.target == this && this.splitType == 1 && this.inGap1(var1.x, var1.y)) {
- this.setCursor(this.moveSplitCursor);
- return true;
- } else {
- if (!this.doMoveSplit && !this.inGap(var1)) {
- this.resetCursor();
- }
-
- return true;
- }
- }
- }
- }
-
- public int iGapWidth() {
- return this.iGapWidth;
- }
-
- public int iGapHeight() {
- return this.iGapHeight;
- }
-
- public int oGapWidth() {
- return this.oGapWidth;
- }
-
- public int oGapHeight() {
- return this.oGapHeight;
- }
-
- public int iBdrSize() {
- return this.iBdrSize;
- }
-
- public int oBdrSize() {
- return this.oBdrSize;
- }
-
- private int optSize(int var1, int var2, int var3, int var4, int var5, int var6) {
- int var9 = Math.max(var2, 0);
- int var10 = Math.max(var3, 1);
- int var11 = Math.max(var4, 1);
- int var12 = Math.max(var5, var10);
- int var13 = Math.max(var6, var11);
- int var7 = var1 - (var12 + var13 + var9);
- if (var7 >= 0) {
- float var16 = (float)var12 / (float)(var12 + var13);
- return var12 + (int)((float)var7 * var16);
- } else {
- var7 = var1 - (var10 + var11 + var9);
- if (var7 >= 0) {
- float var15 = (float)var12 / (float)(var12 + var13);
- return var10 + (int)((float)var7 * var15);
- } else if (var1 > var9) {
- float var8 = (float)var10 / (float)(var10 + var11);
- return var10 + (int)((float)var7 * var8);
- } else {
- return var1;
- }
- }
- }
-
- public synchronized void layout() {
- this.placeComponents();
- }
-
- private void placeComponents() {
- Rectangle var13 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
- if (this.isOuter) {
- int var16 = this.oGapWidth + this.oBdrSize;
- int var18 = this.oGapHeight + this.oBdrSize;
- int var20 = var13.width - (2 * this.oGapWidth + this.oBdrSize + 1);
- int var22 = var13.height - (2 * this.oGapHeight + this.oBdrSize + 1);
- this.innerSP.reshape(var16, var18, var20, var22);
- } else {
- Dimension var1;
- Dimension var3;
- if (this.sub1 == null) {
- var3 = new Dimension(1, 1);
- var1 = new Dimension(1, 1);
- } else {
- var3 = this.sub1.minimumSize();
- var1 = this.sub1.preferredSize();
- }
-
- Dimension var2;
- Dimension var4;
- if (this.sub2 == null) {
- var4 = new Dimension(1, 1);
- var2 = new Dimension(1, 1);
- } else {
- var4 = this.sub2.minimumSize();
- var2 = this.sub2.preferredSize();
- }
-
- this.dimChanged = false;
- byte var5;
- byte var6;
- int var7;
- int var8;
- int var9;
- int var10;
- int var11;
- int var12;
- switch (this.splitType) {
- case 0:
- if (this.spComponent != null) {
- var5 = this.iBdrSize;
- var6 = this.iBdrSize;
- var9 = var13.width - 2 * this.iBdrSize;
- var10 = var13.height - 2 * this.iBdrSize;
- if (var9 < 0) {
- var9 = 0;
- }
-
- if (var10 < 0) {
- var10 = 0;
- }
-
- if (this.propResize) {
- this.spComponent.reshape(var5, var6, var9, var10);
- } else {
- this.spComponent.move(var5, var6);
- }
-
- this.spComponent.layout();
- this.spComponent.invalidate();
- this.spComponent.validate();
-
- try {
- this.spComponent.repaint();
- return;
- } catch (Exception var14) {
- ((Component)this).repaint();
- return;
- }
- }
-
- return;
- case 1:
- var5 = 0;
- var6 = 0;
- var9 = this.optSize(var13.width, this.iGapWidth, var3.width, var4.width, var1.width, var2.width);
- var10 = var13.height;
- var7 = var9 + this.iGapWidth;
- var8 = 0;
- var11 = var13.width - var7;
- var12 = var13.height;
- break;
- case 2:
- var5 = 0;
- var6 = 0;
- var9 = var13.width;
- var10 = this.optSize(var13.height, this.iGapHeight, var3.height, var4.height, var1.height, var2.height);
- var7 = 0;
- var8 = var10 + this.iGapHeight;
- var11 = var13.width;
- var12 = var13.height - var8;
- break;
- default:
- return;
- }
-
- if (this.heightOnly) {
- this.heightOnly = false;
- this.sub1.reshapeHeight(var6, var10);
- this.sub2.reshapeHeight(var8, var12);
- } else if (this.widthOnly) {
- this.widthOnly = false;
- this.sub1.reshapeWidth(var5, var9);
- this.sub2.reshapeWidth(var7, var11);
- } else {
- this.sub1.reshape(var5, var6, var9, var10);
- this.sub2.reshape(var7, var8, var11, var12);
- }
-
- this.sub1.invalidate();
- this.sub1.validate();
- this.sub1.repaint();
- this.sub2.invalidate();
- this.sub2.validate();
- this.sub2.repaint();
- }
- }
-
- public void moveSplit(int var1, int var2) {
- if (this.isOuter) {
- this.innerSP.moveSplit(var1, var2);
- } else {
- Dimension var5 = this.sub1.minimumSize();
- Dimension var6 = this.sub2.minimumSize();
- Rectangle var3 = new Rectangle(this.sub1.curLoc.x, this.sub1.curLoc.y, this.sub1.curDim.width, this.sub1.curDim.height);
- Rectangle var4 = new Rectangle(this.sub2.curLoc.x, this.sub2.curLoc.y, this.sub2.curDim.width, this.sub2.curDim.height);
- int var7 = var3.x;
- int var8 = var3.y;
- if (this.splitType == 2) {
- if (var2 == 0) {
- return;
- }
-
- int var10;
- int var14;
- if (var2 > 0) {
- if (this.enforceMinDim) {
- var14 = Math.max(var4.height - var2, var6.height);
- } else {
- var14 = Math.max(var4.height - var2, 2 * this.iBdrSize);
- }
-
- var10 = var3.height + var4.height - var14;
- } else {
- if (this.enforceMinDim) {
- var10 = Math.max(var3.height + var2, var5.height);
- } else {
- var10 = Math.max(var3.height + var2, 2 * this.iBdrSize);
- }
-
- var14 = var4.height + var3.height - var10;
- }
-
- int var9 = var3.width;
- int var13 = var4.width;
- int var11 = var4.x;
- int var12 = var4.y - var3.height + var10;
- this.sub1.reshapeHeight(var8, var10);
- this.sub2.reshapeHeight(var12, var14);
- }
-
- if (this.splitType == 1) {
- if (var1 == 0) {
- return;
- }
-
- int var15;
- int var19;
- if (var1 > 0) {
- if (this.enforceMinDim) {
- var19 = Math.max(var4.width - var1, var6.width);
- } else {
- var19 = Math.max(var4.width - var1, 2 * this.iBdrSize);
- }
-
- var15 = var3.width + var4.width - var19;
- } else {
- if (this.enforceMinDim) {
- var15 = Math.max(var3.width + var1, var5.width);
- } else {
- var15 = Math.max(var3.width + var1, this.iBdrSize);
- }
-
- var19 = var4.width + var3.width - var15;
- }
-
- int var16 = var3.height;
- int var20 = var4.height;
- int var18 = var4.y;
- int var17 = var4.x - var3.width + var15;
- this.sub1.reshapeWidth(var7, var15);
- this.sub2.reshapeWidth(var17, var19);
- }
-
- this.sub1.invalidate();
- this.sub1.validate();
- this.sub1.repaint();
- this.sub2.invalidate();
- this.sub2.validate();
- this.sub2.repaint();
- }
- }
-
- public void update(Graphics var1) {
- this.paint(var1);
- }
-
- private void draw3DBdr(Graphics var1, int var2, int var3, int var4, int var5, int var6, Color var7, boolean var8) {
- if (var6 >= 0) {
- var1.setColor(this.use3dBdr ? var7 : var7.darker());
-
- for(int var9 = 0; var9 < var6; ++var9) {
- if (this.use3dBdr) {
- var1.draw3DRect(var2 + var9, var3 + var9, var4 - 2 * var9, var5 - 2 * var9, var8);
- } else {
- var1.drawRect(var2 + var9, var3 + var9, var4 - 2 * var9, var5 - 2 * var9);
- }
- }
-
- }
- }
-
- public void paint(Graphics var1) {
- if (this.dimChanged) {
- this.placeComponents();
- }
-
- Dimension var3 = ((Component)this).size();
- Color var2 = ((Component)this).getBackground();
- var1.setColor(var2);
- if (this.isOuter) {
- var1.setColor(this.gapColor);
- var1.fillRect(0, 0, var3.width, var3.height);
- this.draw3DBdr(var1, 0, 0, var3.width - 1, var3.height - 1, this.oBdrSize, this.gapColor, true);
- } else if (this.splitType == 0) {
- var1.setColor(var2);
- var1.fillRect(0, 0, var3.width, var3.height);
- this.draw3DBdr(var1, 0, 0, var3.width - 1, var3.height - 1, this.iBdrSize, this.gapColor, false);
- } else {
- var1.setColor(this.gapColor);
- var1.fillRect(0, 0, var3.width, var3.height);
- }
-
- super.paint(var1);
- }
-
- public Component getComponent() {
- return this.isOuter ? this.innerSP.getComponent() : this.spComponent;
- }
-
- public Component[] getComponents() {
- return null;
- }
-
- private void propagateChanges() {
- if (this.innerSP != null) {
- this.propagateChangesSP(this.innerSP);
- this.innerSP.propagateChanges();
- }
-
- if (this.sub1 != null) {
- this.propagateChangesSP(this.sub1);
- this.sub1.propagateChanges();
- }
-
- if (this.sub2 != null) {
- this.propagateChangesSP(this.sub2);
- this.sub2.propagateChanges();
- }
-
- }
-
- private void propagateChangesSP(SplitterPanel var1) {
- if (var1.oGapWidth != this.oGapWidth || var1.iGapWidth != this.iGapWidth || var1.oGapHeight != this.oGapWidth || var1.iGapHeight != this.iGapHeight || var1.iBdrSize != this.iBdrSize || var1.oBdrSize != this.oBdrSize || var1.use3dBdr != this.use3dBdr) {
- this.dimChanged = true;
- var1.dimChanged = true;
- }
-
- var1.oGapWidth = this.oGapWidth;
- var1.iGapWidth = this.iGapWidth;
- var1.oGapHeight = this.oGapWidth;
- var1.iGapHeight = this.iGapHeight;
- var1.iBdrSize = this.iBdrSize;
- var1.oBdrSize = this.oBdrSize;
- var1.gapColor = this.gapColor;
- var1.enforceMinDim = this.enforceMinDim;
- var1.moveSplitCursor = this.moveSplitCursor;
- var1.propResize = this.propResize;
- var1.use3dBdr = this.use3dBdr;
- }
-
- private Dimension maxDimOf(Dimension var1, Dimension var2) {
- return new Dimension(Math.max(var1.width, var2.width), Math.max(var1.height, var2.height));
- }
-
- public Dimension preferredSize() {
- Dimension var1;
- if (this.isOuter) {
- var1 = new Dimension(this.innerSP.preferredSize());
- var1.width += 2 * (this.oGapWidth + this.oBdrSize);
- var1.height += 2 * (this.oGapHeight + this.oBdrSize);
- } else if (this.splitType == 0) {
- if (this.spComponent == null) {
- var1 = new Dimension(0, 0);
- } else {
- var1 = new Dimension(this.spComponent.preferredSize());
- }
-
- var1.width += 2 * this.iBdrSize;
- var1.height += 2 * this.iBdrSize;
- } else {
- Dimension var2 = this.sub1.preferredSize();
- Dimension var3 = this.sub2.preferredSize();
- if (this.splitType == 2) {
- var1 = new Dimension(var2.width, var2.height + var3.height);
- var1.height += this.iGapHeight;
- } else {
- var1 = new Dimension(var2.width + var2.width, var2.height);
- var1.width += this.iGapWidth;
- }
- }
-
- return this.maxDimOf(this.prefDim, var1);
- }
-
- public Dimension minimumSize() {
- Dimension var1;
- if (this.isOuter) {
- var1 = new Dimension(this.innerSP.minimumSize());
- var1.width += 2 * (this.oGapWidth + this.oBdrSize);
- var1.height += 2 * (this.oGapHeight + this.oBdrSize);
- } else if (this.splitType == 0) {
- if (this.spComponent == null) {
- var1 = new Dimension(0, 0);
- } else {
- var1 = new Dimension(this.spComponent.minimumSize());
- }
-
- var1.width += 2 * this.iBdrSize;
- var1.height += 2 * this.iBdrSize;
- } else {
- Dimension var2 = this.sub1.minimumSize();
- Dimension var3 = this.sub2.minimumSize();
- if (this.splitType == 2) {
- var1 = new Dimension(var2.width, var2.height + var3.height);
- var1.height += this.iGapHeight;
- } else {
- var1 = new Dimension(var2.width + var2.width, var2.height);
- var1.width += this.iGapWidth;
- }
- }
-
- return this.maxDimOf(this.minDim, var1);
- }
-
- public void setPreferredSize(Dimension var1) {
- this.prefDim.width = var1.width;
- this.prefDim.height = var1.height;
- this.prefDim = this.maxDimOf(var1, this.prefDim);
- this.dimChanged = true;
- }
-
- public void setMinimumSize(Dimension var1) {
- this.minDim.width = var1.width;
- this.minDim.height = var1.height;
- this.prefDim = this.maxDimOf(var1, this.prefDim);
- this.dimChanged = true;
- }
-
- public synchronized void reshape(int var1, int var2, int var3, int var4) {
- super.reshape(var1, var2, var3, var4);
- if (this.curDim.width != var3 || this.curDim.height != var4 || this.curLoc.x != var1 || this.curLoc.y != var2) {
- this.dimChanged = true;
- this.curDim.width = var3;
- this.curDim.height = var4;
- this.curLoc.x = var1;
- this.curLoc.y = var2;
- }
-
- }
-
- public synchronized void reshapeWidth(int var1, int var2) {
- Rectangle var3 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
- if (this.curDim.width != var2) {
- this.dimChanged = true;
- this.widthOnly = true;
- this.curDim.width = var2;
- }
-
- this.reshape(var1, var3.y, var2, var3.height);
- }
-
- public synchronized void reshapeHeight(int var1, int var2) {
- Rectangle var3 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
- if (this.curDim.height != var2) {
- this.dimChanged = true;
- this.heightOnly = true;
- this.curDim.height = var2;
- }
-
- this.reshape(var3.x, var1, var3.width, var2);
- }
-
- public synchronized Component add(Component var1, int var2) {
- if (var1 == null) {
- return null;
- } else if (this.isOuter) {
- return this.innerSP.add(var1, var2);
- } else {
- if (this.spComponent != null) {
- super.remove(this.spComponent);
- }
-
- this.spComponent = super.add(var1, -1);
- this.dimChanged = true;
- return this.spComponent;
- }
- }
-
- public synchronized void remove(Component var1) {
- if (this.isOuter) {
- this.innerSP.remove(var1);
- } else if (var1 == this.spComponent) {
- this.spComponent = null;
- super.remove(var1);
- } else {
- if (this.sub1 != null) {
- this.sub1.remove(var1);
- }
-
- if (this.sub2 != null) {
- this.sub2.remove(var1);
- }
-
- }
- }
-
- public synchronized void removeAll() {
- if (this.isOuter) {
- this.innerSP.removeAll();
- } else {
- super.removeAll();
- if (this.sub1 != null) {
- super.add(this.sub1, -1);
- this.sub1.removeAll();
- }
-
- if (this.sub2 != null) {
- super.add(this.sub2, -1);
- this.sub1.removeAll();
- }
- }
-
- this.spComponent = null;
- }
-
- public SplitterPanel split(int var1) {
- return this.split(var1, (Component)null, (Component)null);
- }
-
- public synchronized SplitterPanel split(int var1, Component var2, Component var3) {
- if (this.isOuter) {
- return this.innerSP.split(var1, var2, var3);
- } else if (this.splitType != 0) {
- return null;
- } else if (var1 != 1 && var1 != 2) {
- return null;
- } else {
- this.sub1 = new SplitterPanel(false);
- if (this.sub1 == null) {
- return null;
- } else {
- this.sub2 = new SplitterPanel(false);
- if (this.sub2 == null) {
- super.remove(this.sub1);
- return null;
- } else {
- this.splitType = var1;
- this.sub1.outerSP = this.outerSP;
- this.sub2.outerSP = this.outerSP;
- super.add(this.sub1, -1);
- super.add(this.sub2, -1);
- if (var2 != null) {
- this.sub1.add(var2);
- }
-
- if (var3 != null) {
- this.sub2.add(var3);
- }
-
- return this.sub1;
- }
- }
- }
- }
-
- public void setLayout(LayoutManager var1) {
- }
-
- private Frame findFrame() {
- Object var2 = this;
- Class var3 = this.getClass();
-
- Class var1;
- try {
- var1 = Class.forName("java.awt.Frame");
- } catch (ClassNotFoundException var4) {
- return null;
- }
-
- while(var2 != null) {
- var2 = ((Component)var2).getParent();
-
- for(var3 = var2.getClass(); var3 != var1 && var3 != null; var3 = var3.getSuperclass()) {
- }
-
- if (var3 == var1) {
- return (Frame)var2;
- }
- }
-
- return null;
- }
-
- private void resetCursor() {
- if (this.outerSP.cursorChanged) {
- Frame var1 = this.findFrame();
- if (var1 != null) {
- try {
- var1.setCursor(0);
- this.outerSP.cursorChanged = false;
- } catch (IllegalArgumentException var2) {
- }
- }
- }
- }
-
- private int setCursor(int var1) {
- if (this.outerSP.cursorChanged) {
- return var1;
- } else if (!this.isOuter) {
- return this.outerSP.setCursor(var1);
- } else {
- Frame var2 = this.findFrame();
- if (var2 == null) {
- return Integer.MIN_VALUE;
- } else {
- try {
- var2.setCursor(var1);
- this.cursorChanged = true;
- return var1;
- } catch (IllegalArgumentException var3) {
- return Integer.MIN_VALUE;
- }
- }
- }
- }
-
- private boolean inComponent(Component var1, int var2, int var3) {
- Point var4 = var1.location();
- return var1.inside(var2 - var4.x, var3 - var4.y);
- }
-
- private boolean inGap(Event var1) {
- return this.inGap(var1.x, var1.y);
- }
-
- private boolean inGap(int var1, int var2) {
- if (this.inGap1(var1, var2)) {
- return true;
- } else if (this.isOuter) {
- return this.innerSP.inGap(var1 - this.innerSP.curLoc.x, var2 - this.innerSP.curLoc.y);
- } else if (this.splitType != 2 && this.splitType != 1) {
- return false;
- } else {
- return this.sub1.inGap(var1 - this.sub1.curLoc.x, var2 - this.sub1.curLoc.y) || this.sub2.inGap(var1 - this.sub2.curLoc.x, var2 - this.sub2.curLoc.y);
- }
- }
-
- private boolean inGap1(int var1, int var2) {
- if (!((Component)this).inside(var1, var2)) {
- return false;
- } else if (this.isOuter) {
- return false;
- } else if (this.splitType != 2 && this.splitType != 1) {
- return false;
- } else {
- return !this.inComponent(this.sub1, var1, var2) && !this.inComponent(this.sub2, var1, var2);
- }
- }
-
- public boolean oGapThis(Event var1) {
- if (!this.doMoveSplit && !this.inGap(var1)) {
- this.resetCursor();
- }
-
- return true;
- }
-
- public String toString() {
- String var1 = "Bad Panel ";
- if (this.isOuter) {
- var1 = "Outer ";
- } else {
- if (this.splitType == 0) {
- var1 = "Unsplit ";
- }
-
- if (this.splitType == 1) {
- var1 = "Vertically split ";
- }
-
- if (this.splitType == 2) {
- var1 = "Horizontally split ";
- }
- }
-
- Container var2 = ((Component)this).getParent();
- String var3;
- if (var2 == null) {
- var3 = " with no parent (not added)";
- } else {
- var3 = " with parent @" + var2.hashCode();
- }
-
- return var1 + super.toString() + ": @" + this.hashCode() + var3;
- }
- }
-